/* 
 * Copyright (c) 2021, CENTRIN.CIYUN.LTD. All rights reserved.
 */
package com.cory.boot.domain.chart;

import java.util.List;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import com.google.common.collect.Maps;

/**
 * 雷达图
 * @author xiongcong
 * @date 2021-10-25
 */
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper=true)
public class RadarChart extends Chart {
    
    private Map<String, Object> radar = Maps.newHashMap(); // 雷达图坐标系组件
    
    public RadarChart(String name) {
        super(name);
    }
    
    public RadarChart(String key, String name) {
        super(key, name);
    }
    
    public RadarChart indicator(List<Indicator> indicator) {
        radar.put("indicator", indicator);
        
        return this;
    }
    
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class Indicator {
        private String name;
        private Integer max;
        
        public Indicator(String name) {
            super();
            this.name = name;
        }
    }
}
